---
apiVersion: batch/v1
kind: Job
metadata:
  name: vizier-deleter
  annotations:
    "helm.sh/hook": pre-delete
    "helm.sh/hook-delete-policy": hook-succeeded
  namespace: "{{ .Release.Namespace }}"
spec:
  template:
    metadata:
      name: vizier-deleter
    spec:
      serviceAccountName: pl-deleter-service-account
      restartPolicy: Never
      containers:
      - name: delete-job
        image: operator-vizier_deleter:latest
        env:
        - name: PL_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: PL_VIZIER_NAME
          value: "{{ .Values.name }}"
